package com.winner.data.exception;

/**
 * 业务异常错误码枚举类
 *
 * @author wangxinle5
 * @since 2022-09-20
 */
public enum BusinessEnum {


    /**
     * 请求入参校验异常
     */
    REQUEST_FIELD_ERROR(-2, "request parameters error"),

    /**
     * 请求方式不正确异常(如get写成post)
     */
    REQUEST_METHOD_NOT_SUPPORT(-3, "Request method not supported."),

    /**
     * post请求json格式不正确异常
     */
    INVALIDATE_JSON_FORMAT(-4, "Invalidate Json format, please check."),

    FILE_NOT_FIND(-5, "file not find, download fail."),

    SUCCESS(0, "success"),

    FAIL(1, "fail"),;

    BusinessEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;

    private String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
